package demo.sciau.votesystem.dao;

import demo.sciau.votesystem.entity.PO.UserPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author beifengtz
 * @Date Created in 8:57 2018/10/28
 * @Description:
 */
@Mapper
public interface UserDao {

    List<UserPO> selectUsers();

    UserPO selectUserByPwdAndUsername(@Param("username") String username,
                                      @Param("password") String password);

    List<UserPO> selectUsersByPaging(@Param("index") int i, @Param("limit") int limit);

    int selectUserCount();

    UserPO selectUserById(@Param("uid") String uid);

    UserPO selectUserByUsername(@Param("userName") String userName);

    boolean deleteUserById(@Param("uid") String uid);

    boolean insertUser(@Param("userPO") UserPO userPO);

    boolean updateUser(@Param("userPO") UserPO userPO);

}
